import http from '@/lib/http'

export interface CartPayload {
  id?: number
  userId?: number
  goodId: number
  count: number
  standard?: string
}

export function fetchCart(params?: any) {
  return http.get('/cart', { params })
}

export function addCart(data: CartPayload) {
  return http.post('/cart', data)
}

export function updateCart(data: CartPayload) {
  return http.put('/cart', data)
}

export function deleteCartMany(idList: (number|string)[]) {
  return http.delete('/cart', { params: { idList } })
}


